home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / intrfc70.zip / TPUQ.DOC < prev    next >
Text File  |  1994-03-16  |  4KB  |  106 lines

  1. This is an outline of the structure of the Borland Pascal 7.0 and Turbo
  2. Pascal 7.0 TPU file format.  They use the same format for TPU, TPP, TPW
  3. file, with signature TPUQ.
  4.  
  5. There are six sections; the first one has ten subsections.  Each
  6. section is limited to 64K in size.
  7.  
  8. I. SYMBOL SECTION
  9.  
  10. This section contains all the symbolic information, and has several
  11. subsections.
  12.  
  13. The size is given in header.symsize.  Actual size in file is rounded up
  14. to next even paragraph, as are all the sections.
  15.  
  16. A. Header subsection (/H turns display on)
  17.  
  18. Contains sizes, pointers, flags, and signature TPUQ.  Structure given in
  19. HEAD.PAS. About $60 bytes, but it's not clear where it ends - the last
  20. part is always zeroed.
  21.  
  22. B. Object subsection (/N turns display off, or /I turns full display on)
  23.  
  24. An unfortunate choice of a name:  this section contains all the symbolic
  25. information, not just for Objects.  It contains one or two hash tables
  26. to get access to the various objects:  the interfaced objects are
  27. available from the one at ofs_hashtable, all debuggable ones are
  28. available from the one at ofs_full_hash.  There are also other smaller
  29. hash tables:  members of records, locals to functions/procedures, etc.
  30. HASH.PAS decodes the hash table.
  31.  
  32. There are basically two types of records:  obj_rec's and type_def_rec's.
  33. Obj_rec's give the name and "type", and are followed by specialized
  34. information describing the object.  Type_def_rec's give constructions
  35. for type definitions.  Both are given in NAMELIST.PAS and NAMETYPE.PAS,
  36. though the type_def_rec's should be handled by their own unit.
  37.  
  38. C. Entry point subsection (/E turns display on)
  39.  
  40. This is an array of fixed length records, one per
  41. function/procedure/method in the unit.  It gives the code block of the
  42. routine, and the entry point within that code block.  The first entry is
  43. for the initialization section of the unit.
  44.  
  45. D. Code block subsection (/D turns display on)
  46.  
  47. This is an array of fixed length records, one per block of code
  48. (usually, one per routine, but .OBJ files get just one block).
  49.  
  50. E. Const block subsection (/C turns display on)
  51.  
  52. Another array of fixed length records, one per block of initialized
  53. data. (This will be a typed Const declaration, or the VMT of an object.
  54.  
  55. F. Var block subsection (/V turns display on)
  56.  
  57. The same sort of thing for uninitialized static data.
  58.  
  59. G. Exported names subsection (/W turns display on)
  60.  
  61. This section appears only in TPP or TPW files.  It gives a table
  62. of external names for links to Dynamic Link Libraries.
  63.  
  64. H. Unit list subsection (/U turns display on)
  65.  
  66. All units on which this one depends are listed, in variable length
  67. records.
  68.  
  69. I. Source names subsection (/S turns display on)
  70.  
  71. This section lists the source files, and .OBJ files that were linked
  72. into this unit.
  73.  
  74. J. Line lengths subsection (/M turns display on)
  75.  
  76. If debugging is turned on, the records here give the correspondence
  77. between source code lines and bytes in the code blocks.
  78.  
  79.  
  80. II. CODE SECTION (/B turns display on)
  81.  
  82. This section contains the compiled object code, in the order listed in
  83. the code block subsection above.  It seems there is none
  84. separation between blocks.
  85.  
  86. III. CONST SECTION (/G turns display on)
  87.  
  88. The initialized data, in the order of the const blocks.
  89.  
  90. IV. CODE RELOCATION RECORDS (/R turns display on)
  91.  
  92. A big array of fixed length records, giving the relocation fixups for
  93. the code blocks.
  94.  
  95. V.  CONST RELOCATION RECORDS (/O turns display on)
  96.  
  97. An array in the same format as IV, giving the relocation fixups for the
  98. const blocks.  Used for fixups for the VMT tables of objects, and
  99. initialized pointer constants.
  100.  
  101. VI. BROWSER SYMBOL INFORMATION (/Z turns display on)
  102.  
  103. Appears only when compiled with symbol information turned on {$Y+}.
  104. Symbol information consists of tables that provide line numbers
  105. of all declarations or references to symbols in a module.
  106.